﻿<%@ Page Language="C#" MasterPageFile="~/InventoryTracker/MasterPage.master" AutoEventWireup="true" CodeFile="SIUD.aspx.cs" Inherits="InventoryTracker_SIUD" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="maincontent" Runat="Server">
<div id="projectreport">
        <a name="content_start0" id="content_start0"></a>
        <fieldset>
            <h2 class="none">
                Location Master</h2>
            <legend>Location Information</legend>
            <div class="formsection">
                Location</div>
                
                
                
                <form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server" 
              AutoGenerateColumns="False" 
              DataKeyNames="ID"
              DataSourceID="SqlDSSIUD" 
              OnRowDeleted="GridView1_RowDeleted" 
              OnRowUpdated="GridView1_RowUpdated" 
              ShowFooter="True" 
              OnRowCommand="GridView1_RowCommand" CellPadding="4" 
        ForeColor="#333333" GridLines="None" 
        onselectedindexchanged="GridView1_SelectedIndexChanged">
    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<Columns>
    <asp:CommandField ShowDeleteButton="True" 
                      ShowEditButton="True" />
    <asp:TemplateField HeaderText="ID" SortExpression="ID">
    <ItemTemplate>
    <asp:Label ID="lblID" runat="server" 
                          Text='<%#Eval("ID") %>'>
    </asp:Label>
    </ItemTemplate>
    <FooterTemplate>
    <asp:Button ID="btnInsert" runat="server" 
                Text="Insert" CommandName="Add" />
    </FooterTemplate>
    </asp:TemplateField>
    
    <asp:TemplateField HeaderText="Item Name" 
                       SortExpression="ItemName">
    <ItemTemplate>
    <asp:Label ID="lblItemName" runat="server" 
               Text='<%#Eval("ItemName") %>'>
    </asp:Label>
    </ItemTemplate>
    <EditItemTemplate>
    <asp:TextBox ID="txtItemName" runat="server" 
                 Text='<%#Bind("ItemName") %>'>
    </asp:TextBox>
    </EditItemTemplate>
    <FooterTemplate>
    <asp:TextBox ID="txtItName" runat="server">
    </asp:TextBox>
    </FooterTemplate>
    </asp:TemplateField>
    
    <asp:TemplateField HeaderText="ItemDescription" 
                       SortExpression="ItemDescription">
    <ItemTemplate>
    <asp:Label ID="lblItemDescription" runat="server" 
               Text='<%#Eval("ItemDescription") %>'>
    </asp:Label>
    </ItemTemplate>
    <EditItemTemplate>
    <asp:TextBox ID="txtItemDescription" runat="server" 
                 Text='<%#Bind("ItemDescription") %>'>
    </asp:TextBox>
    </EditItemTemplate>
    <FooterTemplate>
    <asp:TextBox ID="txtItDescription" runat="server">
    </asp:TextBox>
    </FooterTemplate>
    </asp:TemplateField>
    
    <asp:TemplateField HeaderText="Tax" 
                       SortExpression="Tax">
    <ItemTemplate>
    <asp:Label ID="lblTax" runat="server" 
               Text='<%#Eval("Tax") %>'>
    </asp:Label>
    </ItemTemplate>
    <EditItemTemplate>
    <asp:TextBox ID="txtTax" runat="server" 
                 Text='<%#Bind("Tax") %>'>
    </asp:TextBox>
    </EditItemTemplate>
    <FooterTemplate>
    <asp:TextBox ID="txtTxa" runat="server">
    </asp:TextBox>
    </FooterTemplate>
    </asp:TemplateField>
    
    
</Columns>
    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
    <EditRowStyle BackColor="#999999" />
    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
</asp:GridView>

<asp:SqlDataSource ID="SqlDSSIUD" runat="server" 
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [NewTab] WHERE [ID] = @ID" 
InsertCommand="INSERT INTO [NewTab] ([ItemName], 
[ItemDescription],[Tax]) 
VALUES (@ItemName, @ItemDescription, @Tax)"
SelectCommand="SELECT [ID], [ItemName], [ItemDescription], 
[Tax] FROM [NewTab]"
UpdateCommand="UPDATE [NewTab] SET 
[ItemName] = @ItemName, [ItemDescription] = @ItemDescription, 
[Tax] = @Tax WHERE [ID] = @ID" >

<DeleteParameters>
    <asp:Parameter Name="ID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
    <asp:Parameter Name="ItemName" Type="String" />
    <asp:Parameter Name="ItemDescription" Type="String" />
    <asp:Parameter Name="Tax" Type="Int32" />
    <asp:Parameter Name="ID" Type="Int32" />
</UpdateParameters>
<InsertParameters>
    <asp:Parameter Name="ItemName" Type="String" />
    <asp:Parameter Name="ItemDescription" Type="String" />
    <asp:Parameter Name="Tax" Type="Int32" />
</InsertParameters>
</asp:SqlDataSource>
<asp:Label ID="lblMessage" runat="server" 
           Font-Bold="True"></asp:Label><br />
</div>
</form>
         
                
                
                
                 <div class="formsection">
            
                <asp:Button ID="btnLocSubmit" runat="server" Text="Submit"/>
                        
               
            </div>
        </fieldset>
    </div>

</asp:Content>

